//
//  UFOLQCliveCollectionViewCell.m
//  unrivalledForUniverse
//
//  Created by dllo on 1/14/16.
//  Copyright © 2016 dllo. All rights reserved.
//

#import "UFOLQCliveCollectionViewCell.h"

@implementation UFOLQCliveCollectionViewCell

- (void)dealloc
{
    [_image release];
    [_titleLabel release];
    [_nameLabel release];
    [_numLabel release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubviews];
    }
    return self;
}

- (void)createSubviews
{
    self.image = [UIImageView new];
    [self addSubview:self.image];
    
    self.titleLabel = [UILabel new];
    self.titleLabel.backgroundColor = [UIColor whiteColor];
    
    self.titleLabel.font = [UIFont systemFontOfSize:13];
    [self addSubview:self.titleLabel];
    
    self.nameLabel = [UILabel new];
    self.nameLabel.textColor = [UIColor whiteColor];
    self.nameLabel.font = [UIFont systemFontOfSize:13];
    self.nameLabel.backgroundColor = [UIColor colorWithRed:0.024 green:0.029 blue:0.024 alpha:0.450];
    [self addSubview:self.nameLabel];
    
    self.numLabel = [UILabel new];
    self.numLabel.backgroundColor = [UIColor colorWithRed:0.024 green:0.029 blue:0.024 alpha:0.450];
    self.numLabel.font = [UIFont systemFontOfSize:13];
    self.numLabel.textAlignment = NSTextAlignmentCenter;
    self.numLabel.textColor = [UIColor whiteColor];
    [self addSubview:self.numLabel];
    
    [self.image mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.right.equalTo(self).offset(0);
        make.bottom.equalTo(self.titleLabel.mas_top).offset(0);
    }];
    
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.bottom.right.equalTo(self).offset(0);
        make.height.mas_equalTo(@25);
    }];
    
    
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.bottom.equalTo(self.image).offset(0);
        make.right.equalTo(self.numLabel.mas_left).offset(0);
        make.height.mas_equalTo(@25);
    }];
    
    
    [self.numLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.right.equalTo(self.image).offset(0);
        make.right.equalTo(self.image).offset(0);
        make.height.mas_equalTo(@25);
        make.width.mas_equalTo(@70);
    }];
    
}

@end
